<%@page import="java.util.HashMap,utils.msg.PollingQueryRunnable"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<style>
	.data_list .diary_datas{
		 padding: 5px;
	}
</style>

<div class="infoList" align="center">
		<c:if test="${! empty infoList}">
		<div>
			
		</div>
		<table class="table table-bordered table-hover">
			<tr>
				<th>用户事件id</th>
				<th>事件描述</th>
				<th>用户名</th>
				<th>手机</th>
				<th>邮箱</th>
				<th>数据库</th>
				<th>表</th>
				<th>事件类型</th>
				<th>事件条件类型</th>
				<th>轮询时间</th>
				<th>时间片</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			<c:forEach var="info" items="${infoList }">
				<tr>
					<td><span>&nbsp;${info.ueId}</span></td>
					<td><span>&nbsp;${info.desc}</span></td>
					<td><span>&nbsp;${info.username }</span></td>
					<td><span>&nbsp;${info.phoneNumber }</span></td>
					<td><span>&nbsp;${info.email }</span></td>
					<td><span>&nbsp;${info.dbName }</span></td>
					<td><span>&nbsp;${info.tableName }</span></td>
					<td><span>&nbsp;${info.eventType }</span></td>
					<td><span>&nbsp;${info.type }</span></td>
					<td><span>&nbsp;${info.pollingTime }</span></td>
					<td><span>&nbsp;${info.timeSpan }</span></td>
					<c:if test="${map.containsKey(info.ueId)}">
						<td><span><i class="glyphicon glyphicon-ok" style="color: green">&nbsp;</i></span></td>
						<td>
							<input disabled="disabled" type="button" class="btn btn-primary" onclick="javascript:window.location='AdminServlet?method=startThread&ueId=${info.ueId}'" value="启动"/>
							&nbsp;&nbsp;
						    <input type="button" class="btn btn-primary" onclick="javascript:window.location='AdminServlet?method=stopThread&ueId=${info.ueId}'" value="停止"/>
						</td>
					</c:if>
					<c:if test="${!map.containsKey(info.ueId)}">
						<td><span><i class="glyphicon glyphicon-remove" style="color: red">&nbsp;</i></span></td>
						<td>
							<input type="button" class="btn btn-primary" onclick="javascript:window.location='AdminServlet?method=startThread&ueId=${info.ueId}'" value="启动"/>
							&nbsp;&nbsp;
						    <input disabled="disabled" type="button" class="btn btn-primary" onclick="javascript:window.location='AdminServlet?method=stopThread&ueId=${info.ueId}'" value="停止"/>
						</td>
					</c:if>
				</tr>
			</c:forEach>
		</table>
		</c:if>
</div>
